function completeDate(value){
    return value < 10 ? "0"+value:value;
}

export default function formatTime(){   //时间格式：yyyy-mm-dd
    let date = new Date();

    let year = date.getFullYear();
    let month = date.getMonth() + 1;
    let day = date.getDate();

    let now = `${year}-${completeDate(month)}-${completeDate(day)}`;  //当前时间

    let date2 = new Date(date);

    date2.setDate(date.getDate() - 6);

    let front = date2.getFullYear() + '-' +  completeDate(date2.getMonth() + 1) + '-' + completeDate(date2.getDate());

    return [front,now];
}